package com.riku.demo.service;

import com.riku.demo.mapper.TestMapper;
import com.riku.demo.model.Test;
import com.riku.demo.tryagain.config.TryAgain;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TestServiceImpl implements TestService{

    @Autowired
    private TestMapper testMapper;

    @TryAgain
    @Override
    public Test getOne(Long id) {

        if (1 == 1) {
            throw new RuntimeException("发生异常");
        }
        return testMapper.selectById(id);
    }
}
